package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.HarvestingMapper;
import com.youlai.boot.system.mapper.HygieneMapper;
import com.youlai.boot.system.model.QB.Harvesting;
import com.youlai.boot.system.service.HarvestingService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class HarvestingServiceImpl extends ServiceImpl<HarvestingMapper, Harvesting> implements HarvestingService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private HarvestingMapper harvestingMapper;
    @Override
    public boolean saveHarvesting(Harvesting harvesting) {

        harvesting.setAddtime(LocalDateTime.now());
        return save(harvesting);
    }

    @Override
    public List<Harvesting> getAllHarvesting() {
        return harvestingMapper.selectList(null);
    }

    @Override
    public boolean deletHarvestingById(Integer id) {
        return harvestingMapper.deleteById(id) > 0;
    }
}
